package edu.colorado.csci5548.gps_messenger;

public class Location 
{
	private double _latitude;	
	private double _longitude;

	// constructors
	Location(double latitude, double longitude)
	{
		_latitude = latitude;		
		_longitude = longitude;
	}
	
	Location()
	{
		this(40.017624, -105.27966);
	}
	
	Location(Location location)
	{
		this(location.getLatitude(), location.getLongitude());
	}
	
	// getters
	public double getLatitude()
	{
		return _latitude;
	}
	
	public double getLongitude()
	{
		return _longitude;
	}
	
	// setters
	public void setLatitude(double latitude)
	{
		_latitude = latitude;
	}
	
	public void setLongitude(double longitude)
	{
		_longitude = longitude;
	}

	// other methods
	public String toString()
	{
		return "Latitude: " + _latitude + "\n" +
				"Longitude: " + _longitude;
	}
	
	public boolean equals(Location location)
	{
	    if (_latitude == location.getLatitude() &&
	    		_longitude == location.getLongitude())
	        return true;
	    else
	        return false;
	}	
}
